﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<style>
    #demo{
        width: 80px;
        margin-left: 0;
        margin-right: 0;
    }
    #demo1{
        width: 80px;
        margin-left: 0;
        margin-right: 0;
    }
    .form_label{
        margin-left: -150px;
        margin-right: 0px;
    }
</style>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
<title>线路情况</title>
<link href="/xiaozu/css/main.css" rel="stylesheet" type="text/css">
    <link href="/xiaozu/bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/xiaozu/bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css">

</head>
<body>
<form>
<div class="tabe_div">
    <p class="p_line text_ient"><a class="find_a">名称：</a><input name="" type="text" class="form_input text_ient" placeholder="输入名称"/>
    <a class="find_a">起点：</a><input name="tt_travel_Start" type="text" class="form_input text_ient" style="width: 80px;" placeholder="输入起点"/>
    <a class="find_a">终点：</a><input name="tt_travel_End" type="text" class="form_input text_ient" style="width: 80px;" placeholder="输入终点"/>
    <a  class="find_a">类型：</a>
    <select class="form_select" style="padding-left: 1%;">
        <option value="0">全部</option>
        <option value="1">跟团</option>
        <option value="2">周末游</option>
        <option value="3">自由行</option>
        <option value="4">其他</option>
    </select>
    <a class="find_a">时间：</a><label class="form_label"></label><input value="${tt_travel_Createtime}" name="tt_travel_Createtime" class="form_date" id="demo"/>
    <input type="button" value="查询" class="but_find"/><p>
    <p class="p_table">
    <a href="#" class="a_add">全部导出</a>
</p>




    <table id="table" class="table_style" style="margin: 0 auto" >
        <c:forEach var="travel" items="${travelList }" varStatus="status">
            <tr>
                <td>
                    <span>${travel.tt_travel_Id }</span>
                </td>
                <td>
                    <span>${travel.tt_travel_Name }</span>
                </td>
                <td>
							<span>
								<c:if test="${travel.tt_travel_Type==1}">国内社</c:if>
								<c:if test="${travel.tt_travel_Type==2}">国外社</c:if>
							</span>
                </td>
                <td>
                    <span><fmt:formatDate value="${travel.tt_travel_Createtime}" pattern="yyyy-MM-dd"/></span>
                </td>
                <td>
                    <span>${travel.tt_travel_Start}</span>
                </td>
                <td>
                    <span>${travel.tt_travel_End}</span>
                </td>
                <td>
                    <span>${travel.tt_travel_Phone}</span>
                </td>
                <td>
                    <span>${travel.tt_travel_Adress}</span>
                </td>

            </tr>
        </c:forEach>
    </table>





</div>
</form>
<div></div>
<script src="/xiaozu/js/jquery.js"></script>
<script src="/xiaozu/js/date/js/laydate.js"></script>
<script src="/xiaozu/bstable/js/bootstrap.min.js"></script>
<script src="/xiaozu/bstable/js/bootstrap-table.js"></script>
<script src="/xiaozu/bstable/js/bootstrap-table-zh-CN.min.js"></script>
<script>
    !function () {
        laydate.skin('danlan'); //切换皮肤，请查看skins下面皮肤库
        laydate({ elem: '#demo' });
        laydate({ elem: '#demo1' }); //绑定元素
    } ();
</script>

<script type="text/javascript">
    $(function() {
        $('#table')
            .bootstrapTable({
                method: "get",
                striped: true,
                singleSelect: false,
                url: "/xiaozu/json/traveBasic.json",
                dataType: "json",
                pagination: true, //分页
                pageSize: 10,
                pageNumber: 1,
                search: false, //显示搜索框
                contentType: "application/x-www-form-urlencoded",
                queryParams: null,
                columns: [
                    {
                        title: "编号",
                        field: 'id',
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        title: '名称',
                        field: 'name',
                        align: 'center',
                        valign: 'middle',
                        formatter: function (value, row) {
                            var c = "<a onclick='showRoomsRem(" + row.id + ")'>" + value + "</a>";
                            return c;
                        }
                    },
                    {
                        title: '类型',
                        field: 'type',
                        align: 'center'
                    }, 
                    {
                        title: '建立时间',
                        field: 'buildTime',
                        align: 'center'
                    },
                    {
                        title: '起点',
                        field: 'start',
                        align: 'center'
                    },
                    {
                        title: '终点',
                        field: 'end',
                        align: 'center'
                    },
                    {
                        title: '联系电话',
                        field: 'phone',
                        align: 'center'
                    },
                    {
                        title: '详细地址',
                        field: 'address',
                        align: 'center'
                    },
                    {
                        title: '操作',
                        field: 'oper',
                        align: 'center',
                        formatter: function(value, row) {
                            var c = '<button button="#" mce_href="#" value="' +row.id +'" onclick="showHotelInfo(this)"></button> ';
                            return c;
                        }
                    }
                ]
            });
    });

    function handleEvent(id) {
        this.location.href = "alam_handle.jsp";

    }


</script>
<script src="/xiaozu/layer_v2.1/layer/layer.js"></script>
<script type="text/javascript">
    function showHotelInfo(id) {
        var kl=$(id).val();
        kl.indexOf();
        var tt_travel_Id = kl.replace(/[^0-9]/ig, '')
        alert(tt_travel_Id)
        layer.open({
            type: 2,
            title: '线路信息',
            shadeClose: true,
            shade: 0.5,
            skin: 'layui-layer-rim',
            //            maxmin: true,
            closeBtn: 1,
            area: ['80%', '75%'],
            shadeClose: true,
            closeBtn: 1,
            content: '../travelAgency/routeInfo?tt_travel_Id='+tt_travel_Id
            //iframe的url
        });
    }

    function showRoomsRem(id) {
        layer.open({
            type: 2,
            title: '酒店信息',
            shadeClose: true,
            shade: 0.5,
            skin: 'layui-layer-rim',
            //            maxmin: true,
            closeBtn: 1,
            area: ['80%', '75%'],
            shadeClose: true,
            closeBtn: 1,
            content: 'addHotel.jsp'
            //iframe的url
        });
    }
</script>
</body>
</html>
